import { position } from "../components/utils/pathFill";
import { loadModule } from "./loadModule";

const exports = await loadModule("../../package/wasm/build/pathFill.wasm");
const { __getArray, pathFill } = exports;
export const AsPathFill = (
    [x1, y1]: position,
    [x2, y2]: position
): number[][] => {
    const data = (pathFill as any)(x1, y1, x2, y2);
    const result = __getArray(data).map((i) => __getArray(i));
    return result;
};
